import 'package:flutter/material.dart';
import 'ChildCase.dart';

class ParentCase extends StatefulWidget {
  const ParentCase({Key? key}) : super(key: key);

  @override
  _ParentCaseState createState() => _ParentCaseState();
}

class _ParentCaseState extends State<ParentCase> {
  int count = 10;
  void updateValue(int value) {
    setState(() {
      count = value;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text('父组件标题'),
        ChildCase(count: count, updateCallBack: updateValue)
      ],
    );
  }
}
